package com.ctshk.rpc.order.ship.enums;

import java.util.Arrays;
import java.util.stream.Collectors;

/**
 * @Description
 * @Author wansi <gaylen15527491065@yeah.net>
 * @Date 2021/5/19
 */
public enum ShipCompanyEnums {

    /**
     * 手工产品
     */
    MANUAL_COMPANY(1L,"手工产品"),
    /**
     * API产品
     */
    ZHU_JI_COMPANY(2L,"珠江产品");

    private Long companyType;
    private String companyName;

    ShipCompanyEnums(Long companyType , String companyName){
        this.companyType = companyType;
        this.companyName = companyName;
    }


    public static String getCompanyName(Long companyType){
        ShipCompanyEnums[] values = ShipCompanyEnums.values();
        ShipCompanyEnums shipCompanyEnums = Arrays.stream(values).filter(value -> value.companyType.equals(companyType)).findFirst().orElse(null);
        if(shipCompanyEnums != null){
            return shipCompanyEnums.companyName;
        }
        return "";
    }
}
